package com.novax.ex.activity.open.api;

import com.novax.ex.activity.open.model.request.OperationUserLogRequest;
import com.novax.ex.activity.open.model.request.OperationV2UserLogRequest;
import com.novax.ex.common.results.ReturnResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

import jakarta.validation.Valid;

/**
 * @Description
 * @Author ChenXi
 * @Date 2023/04/18/10:48
 */

@Tag(name = "前台-热币活动落地页V2 活动参与", description = "前台-热币活动落地页V2 活动参与")
@FeignClient(url = "${remote.activity-service.endpoint}", name = "OperationV2UserLogApi", contextId = "OperationV2UserLogApi")
public interface OperationV2UserLogApi {

    @Operation(summary = "报名")
    @PostMapping("/v3/operation-v2/user/log/add")
    ReturnResult<?> add(@RequestHeader("userId") Long uid,
                        @RequestHeader("language") String language,
                        @RequestHeader("ip") String ip,
                        @Valid @RequestBody OperationV2UserLogRequest operationV2UserLogRequest,
                        BindingResult bindingResult);

    @Operation(summary = "查询是否已报名")
    @GetMapping("/v3/operation-v2/user/log/query")
    ReturnResult<?> query(@RequestHeader("userId") Long uid,
                          @RequestHeader("language") String language,
                          @RequestParam("customId") String customId);

}
